package com.ja.openchat.ui.contact;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ja.openchat.R;
import com.ja.openchat.views.UserAvatarView;
import com.zy.openchat.core.model.message.ChatInfo;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class GroupCommonAdapter extends BaseQuickAdapter<ChatInfo, BaseViewHolder> implements LoadMoreModule {

    public GroupCommonAdapter(List<ChatInfo> fullInfos) {
        super(R.layout.adapter_group_comon_list,fullInfos);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, ChatInfo userFullInfo) {
        if(userFullInfo==null){
            return;
        }
        UserAvatarView iv_icon = helper.getView(R.id.iv_icon);
        helper.setText(R.id.iv_title,userFullInfo.title);
        iv_icon.showGroup(userFullInfo);

    }

    @NonNull
    @Override
    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
        return new BaseLoadMoreModule(baseQuickAdapter);
    }
}
